﻿package org.irrev.tools 
{
	import flash.display.DisplayObject;
	import flash.display.DisplayObjectContainer;
	/**
	 * ...
	 * @author hldr
	 */
	public class DisplayTools
	{
		
		public static function removeAllChildren(d:DisplayObjectContainer):void {
			while (d.numChildren) {
				d.removeChildAt(0);
			}	
		}
		
		public static function sendFront(d:DisplayObjectContainer):void {
			var p:DisplayObjectContainer = d.parent;
			if (p) {
				p.setChildIndex(d, p.numChildren);	
			}
		}
		
		public static function sendBack(d:DisplayObjectContainer):void {
			var p:DisplayObjectContainer = d.parent;
			if (p) {
				p.setChildIndex(d, 0);	
			}
		}
		
		
		
	}

}